home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / Claudiane.swf / scripts / frame_111 / DoAction.as < prev   
Encoding:
Text File  |  2011-10-17  |  10.6 KB  |  307 lines

  1. function maojiao_sd(n_sd)
  2. {
  3.    _root.maojiao_sound = new Sound();
  4.    _root.maojiao_sound.attachSound("cat0" + n_sd);
  5.    _root.maojiao_sound.start();
  6.    _root.maojiao_sound.setVolume(100);
  7. }
  8. function to_x0_y0_fun()
  9. {
  10.    for(var _loc4_ in this)
  11.    {
  12.       if(typeof this[_loc4_] == "movieclip" and this[_loc4_]._name.substr(0,1) == "a")
  13.       {
  14.          this[_loc4_].swapDepths(this[_loc4_].dep);
  15.          this[_loc4_]._visible = true;
  16.          this[_loc4_].enabled = true;
  17.          this[_loc4_]._x = this[_loc4_].x0;
  18.          this[_loc4_]._y = this[_loc4_].y0;
  19.       }
  20.    }
  21.    var _loc3_ = 1;
  22.    while(_loc3_ < 12)
  23.    {
  24.       _root["on_clothing" + _loc3_] = undefined;
  25.       _loc3_ = _loc3_ + 1;
  26.    }
  27.    hair_mc._x = hair_mc.x0;
  28.    top_mc._x = top_mc.x0;
  29.    model_mc._x = model_mc.x0;
  30.    mm2_mc._x = mm2_mc.x0;
  31.    hair_mc.enabled = true;
  32.    top_mc.enabled = true;
  33. }
  34. function ok_init()
  35. {
  36.    for(var _loc4_ in this)
  37.    {
  38.       if(typeof this[_loc4_] == "movieclip" and this[_loc4_]._name.substr(0,1) == "a")
  39.       {
  40.          this[_loc4_]._visible = false;
  41.       }
  42.    }
  43.    var _loc3_ = 1;
  44.    while(_loc3_ < 12)
  45.    {
  46.       _root["on_clothing" + _loc3_]._visible = true;
  47.       _root["on_clothing" + _loc3_]._x += _root.xcoor;
  48.       _loc3_ = _loc3_ + 1;
  49.    }
  50.    hair_mc._x += _root.xcoor;
  51.    top_mc._x += _root.xcoor;
  52.    model_mc._x += _root.xcoor;
  53.    mm2_mc._x += _root.xcoor;
  54. }
  55. adsorb_x = 280;
  56. adsorb_y = 280;
  57. center_x = 225;
  58. center_y = 300;
  59. xcoor = 0;
  60. stop();
  61. mymenu = new ContextMenu();
  62. mymenu.hideBuiltInItems();
  63. mymenu.builtInItems.print = true;
  64. _root.menu = mymenu;
  65. for(var i in this)
  66. {
  67.    if(typeof this[i] == "movieclip" and this[i]._name.substr(0,1) == "a")
  68.    {
  69.       this[i].dep = this[i].getDepth();
  70.       this[i].x0 = this[i]._x;
  71.       this[i].y0 = this[i]._y;
  72.       this[i].onPress = function()
  73.       {
  74.          this.swapDepths(this._parent.getNextHighestDepth());
  75.          this.startDrag();
  76.       };
  77.       this[i].onRelease = function()
  78.       {
  79.          trace(this.dep);
  80.          if(Math.abs(this._x - center_x) <= adsorb_x and Math.abs(this._y - center_y) <= adsorb_y)
  81.          {
  82.             if(this != _root.on_clothing1 and this != _root.on_clothing2 and this != _root.on_clothing3 and this != _root.on_clothing4 and this != _root.on_clothing5 and this != _root.on_clothing6 and this != _root.on_clothing7 and this != _root.on_clothing8 and this != _root.on_clothing9 and this != _root.on_clothing10)
  83.             {
  84.                var _loc3_ = random(4) + 1;
  85.                maojiao_sd(_loc3_);
  86.                if(this._name.substr(0,2) == "a1")
  87.                {
  88.                   if(_root.on_clothing1 != undefined)
  89.                   {
  90.                      _root.on_clothing1._x = _root.on_clothing1.x0;
  91.                      _root.on_clothing1._y = _root.on_clothing1.y0;
  92.                      _root.on_clothing1 = undefined;
  93.                   }
  94.                   _root.on_clothing1 = this;
  95.                }
  96.                if(this._name.substr(0,2) == "a2")
  97.                {
  98.                   if(_root.on_clothing2 != undefined)
  99.                   {
  100.                      _root.on_clothing2._x = _root.on_clothing2.x0;
  101.                      _root.on_clothing2._y = _root.on_clothing2.y0;
  102.                      _root.on_clothing2 = undefined;
  103.                   }
  104.                   _root.on_clothing2 = this;
  105.                }
  106.                if(this._name.substr(0,2) == "a3")
  107.                {
  108.                   if(_root.on_clothing3 != undefined)
  109.                   {
  110.                      _root.on_clothing3._x = _root.on_clothing3.x0;
  111.                      _root.on_clothing3._y = _root.on_clothing3.y0;
  112.                      _root.on_clothing3 = undefined;
  113.                   }
  114.                   _root.on_clothing3 = this;
  115.                }
  116.                if(this._name.substr(0,2) == "a4")
  117.                {
  118.                   if(_root.on_clothing4 != undefined)
  119.                   {
  120.                      _root.on_clothing4._x = _root.on_clothing4.x0;
  121.                      _root.on_clothing4._y = _root.on_clothing4.y0;
  122.                      _root.on_clothing4 = undefined;
  123.                   }
  124.                   _root.on_clothing4 = this;
  125.                }
  126.                if(this._name.substr(0,2) == "a5")
  127.                {
  128.                   if(_root.on_clothing5 != undefined)
  129.                   {
  130.                      _root.on_clothing5._x = _root.on_clothing5.x0;
  131.                      _root.on_clothing5._y = _root.on_clothing5.y0;
  132.                      _root.on_clothing5 = undefined;
  133.                   }
  134.                   _root.on_clothing5 = this;
  135.                }
  136.                if(this._name.substr(0,2) == "a6")
  137.                {
  138.                   if(_root.on_clothing6 != undefined)
  139.                   {
  140.                      _root.on_clothing6._x = _root.on_clothing6.x0;
  141.                      _root.on_clothing6._y = _root.on_clothing6.y0;
  142.                      _root.on_clothing6 = undefined;
  143.                   }
  144.                   _root.on_clothing6 = this;
  145.                }
  146.                if(this._name.substr(0,2) == "a7")
  147.                {
  148.                   if(_root.on_clothing7 != undefined)
  149.                   {
  150.                      _root.on_clothing7._x = _root.on_clothing7.x0;
  151.                      _root.on_clothing7._y = _root.on_clothing7.y0;
  152.                      _root.on_clothing7 = undefined;
  153.                   }
  154.                   _root.on_clothing7 = this;
  155.                }
  156.                if(this._name.substr(0,2) == "a8")
  157.                {
  158.                   if(_root.on_clothing8 != undefined)
  159.                   {
  160.                      _root.on_clothing8._x = _root.on_clothing8.x0;
  161.                      _root.on_clothing8._y = _root.on_clothing8.y0;
  162.                      _root.on_clothing8 = undefined;
  163.                   }
  164.                   _root.on_clothing8 = this;
  165.                }
  166.                if(this._name.substr(0,2) == "a9")
  167.                {
  168.                   if(_root.on_clothing9 != undefined)
  169.                   {
  170.                      _root.on_clothing9._x = _root.on_clothing9.x0;
  171.                      _root.on_clothing9._y = _root.on_clothing9.y0;
  172.                      _root.on_clothing9 = undefined;
  173.                   }
  174.                   _root.on_clothing9 = this;
  175.                }
  176.                if(this._name.substr(0,2) == "ax")
  177.                {
  178.                   if(_root.on_clothing10 != undefined)
  179.                   {
  180.                      _root.on_clothing10._x = _root.on_clothing10.x0;
  181.                      _root.on_clothing10._y = _root.on_clothing10.y0;
  182.                      _root.on_clothing10 = undefined;
  183.                   }
  184.                   _root.on_clothing10 = this;
  185.                }
  186.                if(this._name.substr(0,2) == "aw")
  187.                {
  188.                   if(_root.on_clothing11 != undefined)
  189.                   {
  190.                      _root.on_clothing11._x = _root.on_clothing10.x0;
  191.                      _root.on_clothing11._y = _root.on_clothing10.y0;
  192.                      _root.on_clothing11 = undefined;
  193.                   }
  194.                   _root.on_clothing11 = this;
  195.                }
  196.             }
  197.          }
  198.          else
  199.          {
  200.             this._x = this.x0;
  201.             this._y = this.y0;
  202.             if(this._name.substr(0,2) == "a1")
  203.             {
  204.                if(_root.on_clothing1 == this)
  205.                {
  206.                   _root.on_clothing1 = undefined;
  207.                }
  208.             }
  209.             if(this._name.substr(0,2) == "a2")
  210.             {
  211.                if(_root.on_clothing2 == this)
  212.                {
  213.                   _root.on_clothing2 = undefined;
  214.                }
  215.             }
  216.             if(this._name.substr(0,2) == "a3")
  217.             {
  218.                if(_root.on_clothing3 == this)
  219.                {
  220.                   _root.on_clothing3 = undefined;
  221.                }
  222.             }
  223.             if(this._name.substr(0,2) == "a4")
  224.             {
  225.                if(_root.on_clothing4 == this)
  226.                {
  227.                   _root.on_clothing4 = undefined;
  228.                }
  229.             }
  230.             if(this._name.substr(0,2) == "a5")
  231.             {
  232.                if(_root.on_clothing5 == this)
  233.                {
  234.                   _root.on_clothing5 = undefined;
  235.                }
  236.             }
  237.             if(this._name.substr(0,2) == "a6")
  238.             {
  239.                if(_root.on_clothing6 == this)
  240.                {
  241.                   _root.on_clothing6 = undefined;
  242.                }
  243.             }
  244.             if(this._name.substr(0,2) == "a7")
  245.             {
  246.                if(_root.on_clothing7 == this)
  247.                {
  248.                   _root.on_clothing7 = undefined;
  249.                }
  250.             }
  251.             if(this._name.substr(0,2) == "a8")
  252.             {
  253.                if(_root.on_clothing8 == this)
  254.                {
  255.                   _root.on_clothing8 = undefined;
  256.                }
  257.             }
  258.             if(this._name.substr(0,2) == "a9")
  259.             {
  260.                if(_root.on_clothing9 == this)
  261.                {
  262.                   _root.on_clothing9 = undefined;
  263.                }
  264.             }
  265.             if(this._name.substr(0,2) == "ax")
  266.             {
  267.                if(_root.on_clothing10 == this)
  268.                {
  269.                   _root.on_clothing10 = undefined;
  270.                }
  271.             }
  272.             if(this._name.substr(0,2) == "aw")
  273.             {
  274.                if(_root.on_clothing11 == this)
  275.                {
  276.                   _root.on_clothing11 = undefined;
  277.                }
  278.             }
  279.          }
  280.          this.stopDrag();
  281.          this.swapDepths(this.dep);
  282.          _root.matchCheck(this);
  283.       };
  284.    }
  285. }
  286. this.onEnterFrame = function()
  287. {
  288.    if(_root.on_clothing1 != undefined and Math.abs(_root.on_clothing1._x - _root.on_clothing1.xx) < 1 and Math.abs(_root.on_clothing1._y - _root.on_clothing1.yy) < 1 or _root.on_clothing2 != undefined and Math.abs(_root.on_clothing2._x - _root.on_clothing2.xx) < 1 and Math.abs(_root.on_clothing2._y - _root.on_clothing2.yy) < 1)
  289.    {
  290.       model_bady_mc.underwear1_mc._visible = false;
  291.    }
  292.    else
  293.    {
  294.       model_bady_mc.underwear1_mc._visible = true;
  295.    }
  296.    if(_root.on_clothing1 != undefined and Math.abs(_root.on_clothing1._x - _root.on_clothing1.xx) < 1 and Math.abs(_root.on_clothing1._y - _root.on_clothing1.yy) < 1 or _root.on_clothing3 != undefined and Math.abs(_root.on_clothing3._x - _root.on_clothing3.xx) < 1 and Math.abs(_root.on_clothing3._y - _root.on_clothing3.yy) < 1)
  297.    {
  298.       model_bady_mc.underwear2_mc._visible = false;
  299.    }
  300.    else
  301.    {
  302.       model_bady_mc.underwear2_mc._visible = true;
  303.    }
  304. };
  305. _global.bb = random(5) + 1;
  306. _global.aa = random(5) + 1;
  307.